#pragma once

#define _CRT_SECURE_NO_WARNINGS 1
#define DATA_PATH "./../../build/data/"

#ifndef _M_X64

	// 32 bity
	#define OBJ_PLATFORM "x86"
	#ifdef _DEBUG
		#define OBJ_SUFIX "_Win32_Debug"
	#else
		#define OBJ_SUFIX "_Win32_Release"
	#endif
#else
	// 64 bity
	#define OBJ_PLATFORM "x64"
	#ifdef _DEBUG
		#define OBJ_SUFIX "_x64_Debug"
	#else
		#define OBJ_SUFIX "_x64_Release"
	#endif
#endif



#define ALIGN(offset, align) (offset + (align - (offset%align)) % align)

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <fstream>

/*--------------------------------------------------------------------------*/

//#define USE_GLM_SIMD

#ifdef USE_GLM_SIMD
#define GLM_FORCE_SIMD
#define GLM_SIMD_ENABLE_XYZW_UNION
#define GLM_MAT4x4 glm::detail::fmat4x4SIMD
#else
#define GLM_MAT4x4 glm::mat4
#endif

#include "glm/glm.hpp"
#include "glm/ext.hpp"
#include "glm/gtc/quaternion.hpp"
#include "glm/gtx/quaternion.hpp"
#include "glm/gtx/simd_vec4.hpp"
#include "glm/gtx/simd_mat4.hpp"

#include "../LibPugiXML/pugiconfig.hpp"
#include "../LibPugiXML/pugixml.hpp"

/*--------------------------------------------------------------------------*/

typedef	unsigned int	uint;
typedef unsigned short	ushort;
typedef unsigned char	uchar;


#include "../Kernel/ITimer.h"
#include "../Kernel/IMutex.h"
#include "../Kernel/IThread.h"
#include "../Renderer/ITypeRenderer.h"
#include "../Renderer/IConstUpdater.h"
#include "../Renderer/IRequest.h"
#include "../Mesh/ISurface.h"
#include "../Mesh/IModel.h"

#include "../Kernel/ILog.h"
#include "../Kernel/IKernel.h"
#include "../Kernel/IInput.h"
#include "../Shell/IShell.h"
#include "../Renderer/IRenderer.h"
#include "../Renderer/IModelMatrixOwner.h"
#include "../Renderer/DynGeometryMgr.h"
#include "../Renderer/DynamicSurface.h"
#include "../Renderer/RendererStorageMgr.h"
#include "../Renderer/TextMgr.h"
#include "../Renderer/MaterialMgr.h"
#include "../Renderer/PostprocessMgr.h"
#include "../Renderer/QueueMgr.h"
#include "../UserInterface/IUserInterface.h"
#include "../Mesh/IMesh.h"
#include "../Scene/IScene.h"

/*--------------------------------------------------------------------------*/

std::string GetFileName(const std::string& path);
std::string GetFileExt(const std::string& path);
std::string GetFileFullname(const std::string& path);
std::string GetFilePath(const std::string& path);
std::string GetFileContent(const std::string& path);

std::ostream& operator<< (std::ostream& out, const glm::vec2& vec);
std::ostream& operator<< (std::ostream& out, const glm::vec3& vec);
std::ostream& operator<< (std::ostream& out, const glm::vec4& vec);
std::ostream& operator<< (std::ostream& out, const glm::ivec2& vec);
std::ostream& operator<< (std::ostream& out, const glm::ivec3& vec);
std::ostream& operator<< (std::ostream& out, const glm::ivec4& vec);
std::ostream& operator<< (std::ostream& out, const glm::mat4& mat);